package com.stoken.service.impl;

import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;

import com.stoken.service.BonusCalculationService;

public class SystemInitJob implements Job {

	@Override
	public void execute(JobExecutionContext jobContext) throws JobExecutionException {
		  System.out.println("程序初始化数据： "+ new Date().toString());
		  WebApplicationContext webAppContext = ContextLoader.getCurrentWebApplicationContext();
		  BonusCalculationService bonusCalculationService = (BonusCalculationService) webAppContext.getBean("bonusCalculation");
		  bonusCalculationService.initdata();
		  System.out.println("程序初始化数据结束： "+ new Date().toString());
	}

}
